<nz-row class="mb10">
  <nz-col nzSpan="2">
    <button (click)="exportSetting()" nz-button nzType="primary">导出</button>
  </nz-col>
  <nz-col nzSpan="2">
    <button (click)="copy()" nz-button nzType="primary">复制</button>
  </nz-col>
  <nz-col nzOffset="18" nzSpan="2">
    <button (click)="importSetting()" nz-button nzDanger nzType="primary">导入</button>
  </nz-col>
</nz-row>
<div nz-row>
  <textarea [(ngModel)]="settingString" nz-input rows="4"></textarea>
</div>
<nz-divider></nz-divider>
<nz-row>
  <nz-col nzSpan="6">
    <input (keyup.enter)="export2Email()" [(ngModel)]="mailAddr" nz-input placeholder="请输入邮箱地址"/>
  </nz-col>
  <nz-col nzSpan="2">
    <button (click)="export2Email()" nz-button nzType="primary">导出到邮件</button>
  </nz-col>
  <nz-col nzSpan="2">
    <button (nzOnConfirm)="importFromClipboard()" nz-button nzDanger
            nz-popconfirm
            nzPopconfirmPlacement="bottom"
            nzPopconfirmTitle="确定要导入吗?导入会覆盖全部现有数据，请提前做好备份"
            nzType="primary"
    >从剪贴板导入
    </button>
  </nz-col>
</nz-row>
<nz-divider></nz-divider>
<nz-row>
  <nz-col nzSpan="2">
    <button (nzOnConfirm)="resetData()" nz-button nz-popconfirm
            nz-tooltip nzDanger
            nzPopconfirmTitle="确定要初始化数据吗?"
            nzTooltipTitle="初始化数据会覆盖当前全部已修改的数据，可能会造成数据丢失，请先导出数据做好备份"
            nzType="primary"
    >
      初始化数据
    </button>
  </nz-col>
</nz-row>
<nz-divider></nz-divider>
<button (click)="logout()" *ngIf="isLogin$|async" nz-button nzType="primary" type="button">注销</button>

<ng-container *ngIf="!(isLogin$|async)">
  <nz-row>
    <nz-col nzSpan="4">
      <input [(ngModel)]="param.username" nz-input placeholder="输入用户名" type="text"/>
    </nz-col>
    <nz-col nzSpan="4">
      <input [(ngModel)]="param.password" nz-input placeholder="输入密码" type="password"/>
    </nz-col>
    <nz-col nzSpan="2">
      <button (click)="login()" nz-button nzType="primary" type="button">登录</button>
    </nz-col>
  </nz-row>
</ng-container>
